From: Jonathan Dieter Date: Tue, 5 Jun 2018 11:10:47 +0000 (+0300) Subject: Remove unneeded copy_index_item function X-Git-Tag: archive/raspbian/1.1.9+ds1-1+rpi1~1^2~253 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=a39eddd891d30be64291b5555d192508dbb2e7b4;p=zchunk.git Remove unneeded copy_index_item function Signed-off-by: Jonathan Dieter --- diff --git a/src/lib/index/index_common.c b/src/lib/index/index_common.c index 30b9e9f..0484cd9 100644 --- a/src/lib/index/index_common.c +++ b/src/lib/index/index_common.c @@ -93,26 +93,3 @@ void zck_index_free(zckCtx *zck) { zck->header_digest = NULL; } } - -zckIndexItem *copy_index_item(zckIndexItem *src) { - zckIndexItem *dst = zmalloc(sizeof(zckIndexItem)); - if(dst == NULL) { - zck_log(ZCK_LOG_ERROR, "Unable to allocate %lu bytes\n", - sizeof(zckIndexItem)); - return NULL; - } - dst->digest = zmalloc(src->digest_size); - if(dst->digest == NULL) { - free(dst); - zck_log(ZCK_LOG_ERROR, "Unable to allocate %lu bytes\n", - src->digest_size); - return NULL; - } - memcpy(dst->digest, src->digest, src->digest_size); - dst->digest_size = src->digest_size; - dst->valid = src->valid; - dst->start = src->start; - dst->comp_length = src->comp_length; - dst->length = src->length; - return dst; -} diff --git a/src/lib/zck_private.h b/src/lib/zck_private.h index f73e0fd..f76dcf5 100644 --- a/src/lib/zck_private.h +++ b/src/lib/zck_private.h @@ -213,8 +213,6 @@ int zck_write_index(zckCtx *zck) __attribute__ ((warn_unused_result)); zckIndexItem *zck_get_index_of_loc(zckIndex *index, size_t loc) __attribute__ ((warn_unused_result)); -zckIndexItem *copy_index_item(zckIndexItem *src) - __attribute__ ((warn_unused_result)); /* io.c */ int seek_data(int fd, off_t offset, int whence)